/* 生活工具通用样式 */
.section {
    margin-bottom: 2.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.section-title i {
    color: var(--primary);
}

/* 天气预报工具样式 */
.weather-tool {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.weather-search {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f5f5f5;
}

.weather-result {
    display: none;
    flex-direction: column;
    padding: 1.5rem;
}

.current-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.weather-main {
    text-align: center;
    margin-bottom: 1rem;
}

.weather-icon i {
    font-size: 4rem;
    color: #ff9800;
}

.weather-temp {
    font-size: 3rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.weather-desc {
    font-size: 1.2rem;
    color: #555;
    text-transform: capitalize;
}

.weather-city {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.detail-item i {
    font-size: 1.2rem;
    color: var(--primary);
}

.detail-item span {
    flex: 1;
    font-size: 0.9rem;
    color: #666;
}

.detail-item strong {
    font-weight: bold;
}

.forecast {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.forecast-day {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.forecast-item i {
    font-size: 2rem;
    margin: 0.5rem 0;
    color: #2196f3;
}

.forecast-temp {
    font-size: 0.9rem;
}

/* BMI计算器样式 */
.bmi-calculator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: auto;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 1.25rem;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.calculator-result {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.result-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: 8px;
    background-color: #f0f7ff;
    border: 1px solid #d0e3ff;
}

.bmi-value {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: bold;
    color: var(--primary);
    margin: 0.75rem 0;
}

.bmi-category {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #555;
}

.bmi-chart {
    position: relative;
    height: clamp(45px, 12vw, 60px);
    background-color: #f5f5f5;
    border-radius: 30px;
    margin: 1rem 0;
    display: flex;
    overflow: hidden;
}

.chart-bar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    font-size: clamp(0.65rem, 2vw, 0.8rem);
    font-weight: bold;
}

.chart-bar span {
    position: relative;
    z-index: 2;
}

.chart-bar::after {
    content: attr(data-category);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    color: #777;
    white-space: nowrap;
}

.underweight {
    background-color: #4fc3f7;
}

.normal {
    background-color: #66bb6a;
}

.overweight {
    background-color: #ffee58;
}

.obese {
    background-color: #ff7043;
}

.chart-indicator {
    position: absolute;
    top: -10px;
    width: 3px;
    height: clamp(60px, 16vw, 80px);
    background-color: #333;
    transform: translateX(-50%);
    z-index: 3;
}

.chart-indicator::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: clamp(6px, 2vw, 8px) solid transparent;
    border-right: clamp(6px, 2vw, 8px) solid transparent;
    border-top: clamp(8px, 2.5vw, 10px) solid #333;
}

.bmi-tips {
    padding: 1.25rem;
    border-radius: 8px;
    background-color: #fff8e1;
    border: 1px solid #ffe0b2;
}

.bmi-tips h4 {
    color: #ff8f00;
    margin-bottom: 0.75rem;
}

.bmi-tips i {
    margin-right: 6px;
}

.bmi-tips ul {
    padding-left: 1.25rem;
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .calculator-form {
        padding: 1rem;
        max-width: 100%;
    }
    
    .result-card, .bmi-tips {
        padding: 1rem;
    }
    
    .bmi-chart {
        margin: 0.75rem 0;
    }
    
    .chart-bar::after {
        bottom: -18px;
    }
}

/* 单位换算器样式 */
.converter-tool {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.converter-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.converter-tab {
    padding: 0.8rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    position: relative;
}

.converter-tab.active {
    color: var(--primary);
    font-weight: bold;
}

.converter-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary);
}

.converter-content {
    padding: 1.5rem;
}

.converter-pane {
    display: none;
}

.converter-pane.active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.converter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.converter-arrow {
    color: var(--primary);
    font-size: 1.2rem;
}

/* 时间管理工具样式 */
.time-management {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.time-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.time-tab {
    padding: 0.8rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    position: relative;
}

.time-tab.active {
    color: var(--primary);
    font-weight: bold;
}

.time-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary);
}

.time-content {
    padding: 1.5rem;
}

.time-pane {
    display: none;
}

.time-pane.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time {
    font-size: 3rem;
    font-family: monospace;
    margin: 1rem 0;
}

.pomodoro-display,
.stopwatch-display,
.countdown-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.pomodoro-controls,
.stopwatch-controls,
.countdown-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pomodoro-settings,
.countdown-settings {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-inputs input {
    width: 60px;
    text-align: center;
}

.pomodoro-status {
    text-align: center;
    margin-top: 1rem;
}

#pomodoroPhase {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stopwatch-laps {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 1rem;
    border-top: 1px solid #eee;
}

.laps-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .weather-details {
        grid-template-columns: 1fr;
    }

    .forecast {
        grid-template-columns: repeat(2, 1fr);
    }

    .converter-pane.active {
        flex-direction: column;
    }

    .converter-arrow {
        transform: rotate(90deg);
    }

    .pomodoro-settings,
    .countdown-settings {
        flex-direction: column;
    }

    .time {
        font-size: 2rem;
    }
}
